package com.lzc.syn;

/**
 * 调用内类的其他方法
 *
 * @author lizhichuan
 * @date 2024/7/11 10:53
 */
public class SynchronizedOtherMethod11 {

    public static void main(String[] args) {
        SynchronizedOtherMethod11 s = new SynchronizedOtherMethod11();
        s.method1();
    }

    public synchronized void method1(){
        System.out.println("这是method1");
        method2();
    }

    public synchronized void method2(){
        System.out.println("这是method2");
    }


}
